package com.chaoyong.higo.utils;

import android.app.Activity;
import android.view.View;

/**
 * 简化findViewById()方法 实现方式：利用Java中泛型的类型推导
 * 
 * @author zk
 *
 */
public class V {

	@SuppressWarnings("unchecked")
	public static <T extends View> T f(Activity context, int id) {
		return (T) context.findViewById(id);
	}

	@SuppressWarnings("unchecked")
	public static <T extends View> T f(View rootView, int id) {
		return (T) rootView.findViewById(id);
	}

}
